<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
/*
	选择商品modal，通过访问此页面选择获取指定商品id
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
//选择卡包
	$params=array('pluginname'=>'');
	$params['uniacid']=$_SESSION['uniacid'];
	//卡包名称
	if(!empty($_RQ['title'])){
		$params['title']='%'.trim($_RQ['title']).'%';
		$return['params']['title']=$_RQ['title'];
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$fields=array('id','title');
	$list=pdo_getslice('jy_kabao_list',$params,array($pindex,$psize),$total,$fields,'','id desc');
	$return['list']=$list;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	$return['htmls']=array(
		'type'=>'list',
		'list'=>array('data'=>'list','edit'=>false,'delall'=>false,'del_one'=>false,'list'=>array(
			array('type'=>'string','name'=>'id','title'=>'卡包ID'),
			array('type'=>'string','name'=>'title','title'=>'卡包名称'),
		),'action'=>array(
			array('type'=>'modal_result','name'=>'id','title'=>'选取'),
		)),
		'search_one'=>array('name'=>'title'),
	);
	exi($return);
?>